/*
 Copyright (C) 2011 QIDAPP.com. All rights reserved.
 QIDAPP.com PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package org.qdss.oapi4j.apis.paipai;

import org.dom4j.Element;
import org.qdss.oapi4j.ApiHelper;
import org.qdss.oapi4j.ApiParameter;
import org.qdss.oapi4j.Result;
import org.qdss.oapi4j.util.support.AbstractHolder;

/**
 * @author Zhao Fangfang
 * @version $Id: GetUserDetailInfoHolder.java 40 2011-10-09 06:49:39Z zhaofang123@gmail.com $
 * @since 1.9, 2011-9-27
 */
public class GetUserDetailInfoHolder extends AbstractHolder {

	@Override
	public String getApiUrl() {
		return "http://api.paipai.com/user/getUserDetailInfo.xhtml";
	}
	
	/**
	 * 他用型调用
	 * 
	 * @param sellerUin
	 * @param token
	 * @return
	 */
	public Result<Element> doGet(long sellerUin, String token) {
		PaipaiApiInvoker<Element> invoker = ApiHelper.POP_INVOKER;
		ApiParameter apiParameter = invoker.createApiParameter(
				getApiUrl(), sellerUin + "", token);
		apiParameter.addParam("userUin", sellerUin);
		
		Result<Element> result = invoker.invoke(apiParameter);
		return result;
	}
	
	/**
	 * 自用型调用
	 * 
	 * @return
	 */
	public Result<Element> doGetWithSelf() {
		PaipaiApiInvoker<Element> invoker = ApiHelper.POP_INVOKER;
		ApiParameter apiParameter = invoker.createApiParameter(
				getApiUrl(), ApiHelper.POP_UIN, ApiHelper.POP_TOKEN);
		apiParameter.addParam("userUin", ApiHelper.POP_UIN);
		
		Result<Element> result = invoker.invoke(apiParameter);
		return result;
	}
}
